
C$OPENAD XXX File_start [head.f]
      MODULE m
      use OAD_active
      use w2f__types
      use oad_intrinsics
      IMPLICIT NONE
      SAVE
C
C     **** Top Level Pragmas ****
C
      interface I
        module procedure P2
        module procedure P1
      end interface

C
C     **** Statements ****
C
      CONTAINS
C#########################################################
C This file is part of OpenAD released under the LGPL.   #
C The full COPYRIGHT notice can be found in the top      #
C level directory of the OpenAD distribution             #
C#########################################################

        SUBROUTINE P1(X)
          use OAD_tape
          use OAD_rev

C original arguments get inserted before version
C         ! and declared here together with all local variables
C         ! generated by xaifBooster

        use w2f__types
        IMPLICIT NONE
C
C       **** Parameters and Result ****
C
        REAL(w2f__8) X


          integer iaddr
          external iaddr

         if (our_rev_mode%plain) then
C original function
          end if
          if (our_rev_mode%tape) then
C taping
          end if
          if (our_rev_mode%adjoint) then
C adjoint
          end if
        end subroutine P1
C#########################################################
C This file is part of OpenAD released under the LGPL.   #
C The full COPYRIGHT notice can be found in the top      #
C level directory of the OpenAD distribution             #
C#########################################################

        SUBROUTINE P2(X)
          use OAD_tape
          use OAD_rev

C original arguments get inserted before version
C         ! and declared here together with all local variables
C         ! generated by xaifBooster

        use w2f__types
        IMPLICIT NONE
C
C       **** Parameters and Result ****
C
        INTEGER(w2f__i4) X


          integer iaddr
          external iaddr

         if (our_rev_mode%plain) then
C original function
          end if
          if (our_rev_mode%tape) then
C taping
          end if
          if (our_rev_mode%adjoint) then
C adjoint
          end if
        end subroutine P2
      END
C#########################################################
C This file is part of OpenAD released under the LGPL.   #
C The full COPYRIGHT notice can be found in the top      #
C level directory of the OpenAD distribution             #
C#########################################################

      SUBROUTINE foo(X)
          use OAD_tape
          use OAD_rev

C original arguments get inserted before version
C         ! and declared here together with all local variables
C         ! generated by xaifBooster

      use OAD_active
      use w2f__types
      use oad_intrinsics
      use m
      use oad_intrinsics
      use m
      use oad_intrinsics
      use m
      IMPLICIT NONE
C
C     **** Parameters and Result ****
C
      type(active) :: X
C
C     **** Local Variables and Functions ****
C
      INTEGER(w2f__i4) THEINT
      INTEGER(w2f__i4) OpenAD_Symbol_0
      INTEGER(w2f__i4) OpenAD_lin_0
      type(active) :: OpenAD_prp_0
      REAL(w2f__8) OpenAD_tyc_0
      REAL(w2f__8) OpenAD_tyc_1
      REAL(w2f__8) OpenAD_tyc_2
      REAL(w2f__8) OpenAD_tyc_3
      REAL(w2f__8) OpenAD_tyc_5
      REAL(w2f__8) OpenAD_tyc_7


          integer iaddr
          external iaddr
C
C     **** Statements ****
C

         if (our_rev_mode%plain) then
C original function
      THEINT = 2
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(OpenAD_tyc_0,X)
      CALL P1(OpenAD_tyc_0)
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(X,OpenAD_tyc_0)
      X%v = (THEINT*X%v)
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(OpenAD_tyc_1,X)
      CALL P1(OpenAD_tyc_1)
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(X,OpenAD_tyc_1)
      CALL P2(THEINT)
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(OpenAD_tyc_2,X)
      CALL P1(OpenAD_tyc_2)
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(X,OpenAD_tyc_2)
          end if
          if (our_rev_mode%tape) then
C taping
      THEINT = 2
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(OpenAD_tyc_0,X)
      CALL P1(OpenAD_tyc_0)
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(X,OpenAD_tyc_0)
      OpenAD_lin_0 = THEINT
      X%v = (THEINT*X%v)
      double_tape(double_tape_pointer) = OpenAD_lin_0
      double_tape_pointer = double_tape_pointer+1
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(OpenAD_tyc_1,X)
      CALL P1(OpenAD_tyc_1)
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(X,OpenAD_tyc_1)
      CALL P2(THEINT)
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(OpenAD_tyc_2,X)
      CALL P1(OpenAD_tyc_2)
C!! requested inline of 'oad_convert' has no defn
      CALL oad_convert(X,OpenAD_tyc_2)
          end if
          if (our_rev_mode%adjoint) then
C adjoint
      CALL P1(OpenAD_tyc_3)
      CALL P2(THEINT)
      CALL P1(OpenAD_tyc_5)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_0 = double_tape(double_tape_pointer)
      OpenAD_prp_0%d = OpenAD_prp_0%d+X%d*(OpenAD_Symbol_0)
      X%d = 0.0d0
      X%d = X%d+OpenAD_prp_0%d
      OpenAD_prp_0%d = 0.0d0
      CALL P1(OpenAD_tyc_7)
          end if
        end subroutine foo
C#########################################################
C This file is part of OpenAD released under the LGPL.   #
C The full COPYRIGHT notice can be found in the top      #
C level directory of the OpenAD distribution             #
C#########################################################

      SUBROUTINE head(X, Y)
          use OAD_tape
          use OAD_rev

C original arguments get inserted before version
C         ! and declared here together with all local variables
C         ! generated by xaifBooster

      use OAD_active
      use w2f__types
      use oad_intrinsics
      use oad_intrinsics
      use oad_intrinsics
      IMPLICIT NONE
C
C     **** Parameters and Result ****
C
      type(active) :: X(1:1)
      type(active) :: Y(1:1)
C
C     **** Local Variables and Functions ****
C
      EXTERNAL foo
      type(active) :: OpenAD_prp_1(1:1)
C
C     **** Top Level Pragmas ****
C
C$OPENAD INDEPENDENT(X)
C$OPENAD DEPENDENT(Y)
C
C     **** Statements ****
C


          integer iaddr
          external iaddr

         if (our_rev_mode%plain) then
C original function
      X(1:1)%v = (X(1:1)%v*2.0D00)
      CALL foo(X)
      Y(1:1)%v = X(1:1)%v
          end if
          if (our_rev_mode%tape) then
C taping
      X(1:1)%v = (X(1:1)%v*2.0D00)
      CALL foo(X)
      Y(1:1)%v = X(1:1)%v
          end if
          if (our_rev_mode%adjoint) then
C adjoint
      X(1:1)%d = X(1:1)%d+Y(1:1)%d
      Y(1:1)%d = 0.0d0
      CALL foo(X)
      OpenAD_prp_1%d = OpenAD_prp_1%d+X(1:1)%d*(2.0D00)
      X(1:1)%d = 0.0d0
      X(1:1)%d = X(1:1)%d+OpenAD_prp_1%d
      OpenAD_prp_1%d = 0.0d0
          end if
        end subroutine head
